package com.andertrift.connectors;

import java.io.ObjectInputStream.GetField;

import com.google.code.linkedinapi.client.LinkedInApiClient;
import com.google.code.linkedinapi.client.LinkedInApiClientFactory;
import com.google.code.linkedinapi.client.enumeration.ProfileType;
import com.google.code.linkedinapi.schema.Person;

public class LinkedinConnector {

	final LinkedInApiClientFactory factory;
	final LinkedInApiClient client;
	
	public LinkedinConnector() {
		String consumerKeyValue = "jn5fbntqa157";
		String accessTokenValue ="977ebcdf-2326-421a-9e55-c981fa6e5764";
		String consumerSecretValue="CWz6MZQdECuNZWSF";
		String tokenSecretValue ="e605739d-6bf1-496e-a3f3-f9ac86c8b415";
		factory = LinkedInApiClientFactory.newInstance(consumerKeyValue, consumerSecretValue);
		client = factory.createLinkedInApiClient(accessTokenValue, tokenSecretValue);		
	}
	
	public void getProfileInfo(String id) {
		Person profile = client.getProfileByUrl("http://www.linkedin.com/pub/mathias-van-de-pol/56/613/491", ProfileType.STANDARD);
		System.out.println("Name:" + profile.getFirstName() + " " + profile.getLastName());
		System.out.println("Id:" + profile.getId());
		System.out.println("Headline:" + profile.getHeadline());
		System.out.println("Summary:" + profile.getSummary());
		System.out.println("Industry:" + profile.getIndustry());
		System.out.println("Picture:" + profile.getPictureUrl());
	}
	
	public void postCompanyPost(String message){
	//	client.postShar
	}
	
}